eststo clear
local VAR  lngrosspay 
foreach v of local VAR{
	
eststo: reghdfe `v' sh_r_fm  , abs(wid) vce(cluster FE_factmonth)	 
  quietly estadd local est ="All", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U = e(K1), replace   	
  
eststo: reghdfe `v' sh_r_fm if general_designation==1. , abs(wid) vce(cluster FE_factmonth)  
  quietly estadd local est ="Non-line", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  e(K1), replace  
 
eststo: reghdfe `v' sh_r_fm if manager_designation==1. , abs(wid) vce(cluster FE_factmonth)
  quietly estadd local est ="Managers", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  e(K1) , replace  
}
local VAR  lnovertime_hours 
foreach v of local VAR{
	
eststo: reghdfe `v' sh_r_fm  , abs(wid) vce(cluster FE_factmonth)	 
  quietly estadd local est ="All", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U = e(K1), replace   	
  
eststo: reghdfe `v' sh_r_fm if general_designation==1. , abs(wid) vce(cluster FE_factmonth)  
  quietly estadd local est ="Non-line", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  e(K1), replace  
 
eststo: reghdfe `v' sh_r_fm if manager_designation==1. , abs(wid) vce(cluster FE_factmonth)
  quietly estadd local est ="Managers", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  e(K1) , replace  
}
drop lnabsentdays  
gen lnabsentdays=ln(absentdays+1)
  
local VAR  lnabsentdays
foreach v of local VAR{
	
eststo: reghdfe `v' sh_r_fm  , abs(wid) vce(cluster FE_factmonth)	 
  quietly estadd local est ="All", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U = e(K1), replace   	
  
eststo: reghdfe `v' sh_r_fm if general_designation==1. , abs(wid) vce(cluster FE_factmonth)  
  quietly estadd local est ="Non-line", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  e(K1), replace  
 
eststo: reghdfe `v' sh_r_fm if manager_designation==1. , abs(wid) vce(cluster FE_factmonth)
  quietly estadd local est ="Managers", replace  
  quietly estadd local FE ="i", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  e(K1) , replace   
  
}
esttab using "${tables}\TableC13.tex", ///
  title("Overtime and Pay when Producing for Relational Buyers" \label{UpDown}) ///
  label replace booktabs b(3) se(3) noconstant obslast substitute(\_ _) ///
  drop() order() /// 
  stats(est FE   r2   N U   , fmt(%~#s %~#s   2 %12.0fc %12.0fc  )  ///
  labels("Type Worker" "FEs"  `"\(R^{2}\)"'  "Obs." "Workers" ))   ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  nonotes  